package main

import (
	"fmt"

	"github.com/apache/arrow/go/v6/arrow/array"
	"github.com/apache/arrow/go/v6/arrow/math"
	"github.com/apache/arrow/go/v6/arrow/memory"
)

func main() {
	fb := array.NewFloat64Builder(memory.DefaultAllocator)

	fb.AppendValues([]float64{1, 3, 5, 7, 9, 11}, nil)

	vec := fb.NewFloat64Array()

	for _, val := range vec.Float64Values() {
		fmt.Printf("%f\t", val)
	}

	fmt.Printf("\n--------------------------------------------------------------------------------------------\n")

	sum := math.Float64.Sum(vec)

	fmt.Printf("sum = %f\n", sum)

}
